import org.apache.thrift.TException;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransportException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;

public class HelloClient{
	public static void main(String [] args){
		try{
			TTransport transport = new TSocket("localhost", 9090);
			TProtocol protocol = new TBinaryProtocol(transport);
			Hello.Client client = new Hello.Client(protocol);

			transport.open();
			String result = client.say("world");
			System.out.println(result);
			transport.close();
		}
		catch(TException ex){
			ex.printStackTrace();
		}
	}
}
